package com.company;

import java.util.Objects;

public class Main {



    public static void main(String[] args) {
	// write your code here
       Object o= new Object();
       int a=o.hashCode();
       System.out.println(a);
       System.out.println(o.toString());
      System.out.println(o.equals("abc"));
        System.out.println();

        Newlion n= new Newlion("渣渣辉",20);
        Newlion n1=new Newlion("渣渣辉",20);
       // System.out.println(n.age);
       // System.out.println(n.name);
        System.out.println(n);
        System.out.println(n.equals(n1));

    }
}
class Newlion{
    @Override
    public String toString() {
        return "Newlion{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    String name;
    int age;
    public Newlion() { }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Newlion newlion = (Newlion) o;
        return age == newlion.age &&
                name.equals(newlion.name);
    }



    public  Newlion(String name, int age){

        this.name=name;
        this.age=age;

 }

}